<script setup lang="ts">
import useFetch from '@/hooks/useFetch'
import { useRoute } from 'vue-router'

const { params, query } = useRoute()
const headers = {
  Authorization: 'Bearer ' + query.token,
}

const { loading, data } = useFetch(`/api/v1/boss/ViewReportHtml`, {
  defaultParams: {
    reportId: params.id,
    reportJson: query.json,
  },
  headers,
  otherOptions: {
    isJson: false,
  },
})
</script>

<template>
  <div v-html="data"></div>

  <div v-if="loading" class="text-center py-5">正在加载</div>
</template>
